package com.fuyun.rpc.common.exception;

/**
 * RPC通用异常类
 */
public class RpcException extends RuntimeException {

	/**
	 * 异常码
	 */
	private String code;

	/**
	 * 异常详情
	 */
	private Object detail;

	public RpcException(String message) {
		super(message);
	}

	public RpcException(String code, String message) {
		super(message);
		this.code = code;
	}

	public RpcException(String code, String message, Object detail) {
		super(message);
		this.code = code;
		this.detail = detail;
	}

	public RpcException(String message, Throwable cause) {
		super(message, cause);
	}

	public RpcException(String code, String message, Throwable cause) {
		super(message, cause);
		this.code = code;
	}

	public RpcException(String code, String message, Object detail, Throwable cause) {
		super(message, cause);
		this.code = code;
		this.detail = detail;
	}

	// Getter and Setter
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Object getDetail() {
		return detail;
	}

	public void setDetail(Object detail) {
		this.detail = detail;
	}
}